extends AbstractCsv
class_name RecipeCsv

var columns := ["id1", "id2", "target_id", "name"]

func _row_to_object(fields, _header):
	var d := {}
	for i in range(columns.size()):
		d[columns[i]] = fields[i]
	return d

func _object_to_row(obj, _header):
	return PackedStringArray([
		str(obj["id1"]),
		str(obj["id2"]),
		str(obj["target_id"]),
		str(obj["name"])
	])

func _get_header(_objects):
	return PackedStringArray(columns)
